package com.mashibing.strategy.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Map;
import java.util.Set;

/**
 * @author SNA
 * @date 2025/8/20
 * @Description
 **/
@FeignClient(value = "beacon-cache")
public interface BeaconCacheClient {

    @GetMapping("/cache/hget/{key}/{field}")
    String hget(@PathVariable("key") String key, @PathVariable("field") String field);

    @GetMapping("/cache/hget/{key}/{field}")
    Integer hgetInteger(@PathVariable("key") String key, @PathVariable("field") String field);

    @GetMapping("/cache/hgetall/{key}")
    Map hGetAll(@PathVariable("key") String key);

    @GetMapping("/cache/get/{key}")
    String getString(@PathVariable("key") String key);

    @PostMapping(value = "/cache/sinterstr/{key}/{sinterKey}")
    Set<Object> sinterStr(@PathVariable("key") String key, @PathVariable("sinterKey") String sinterKey,
                          @RequestBody String... value);

    @GetMapping("/cache/smember/{key}")
    Set<String> smember(@PathVariable("key") String key);

    @GetMapping("/cache/smember/{key}")
    Set<Map> smemberMap(@PathVariable("key") String key);

    @PostMapping(value = "/cache/zadd/{key}/{score}/{member}")
    Boolean zadd(@PathVariable("key") String key, @PathVariable("score") Long score, @PathVariable("member") Object member);

    @GetMapping(value = "/cache/zrangebyscorecount/{key}/{start}/{end}")
    int zRangeByScoreCount(@PathVariable("key") String key, @PathVariable("start") Double start, @PathVariable("end") Double end);

    @DeleteMapping(value = "/cache/zremove/{key}/{member}")
    void zRemove(@PathVariable("key") String key, @PathVariable("member") String member);

    @PostMapping(value = "/cache/hincrby/{key}/{field}/{delta}")
    Long hIncrBy(@PathVariable("key") String key, @PathVariable("field") String field, @PathVariable("delta") Long delta);
}
